In practical applications of RFID, in many cases, a reader-writer in a radio frequency field is corresponding to a plurality of electronic tags. When a reader-writer counts a plurality of electronic tags at the same time, channel competition occurs, which causes collision, such that the electronic tags are unable to transmit information to the reader-writer correctly. Therefore, it is desirable to adopt a certain mechanism to avoid the collision or reduce the collision.
In the current RFID international standard ISO 18000-6, to solve the collision is problem, time slot ALOHA algorithm is employed for type A and type C, while a binary tree algorithm is employed for type B. Both the time slot ALOHA and the binary tree are based on time division multiple access mode.
The time slot ALOHA algorithm means that divide time into some discrete time slots, the tags are required to select one of the time slots randomly and transmit data at the border of the time slots. In the protocol of type A and type C of the ISO 18000-6, the process of implementing anti-collision by using the time slot ALOHA algorithm is: at the beginning of each counting process, the reader-writer notifies all tags of a range of selectable time slots, in which the tags randomly select a time slot for responding, the tags either transmit successfully or collide completely; if collision occurs, reselecting a time slot and retransmitting until all tags transmit successfully.
The basic concept of the binary tree algorithm is that: the tags in collision are split into two subsets 0 and 1 on the left and right respectively; subset 0 is inquired firstly, the tags are identified correctly if there is no collision; the tags in collision are split again if there is collision, the subset 0 is split into two subsets subset 00 and subset 01, and so on, until all tags in the subset 0 are identified; and then subset 1 is inquired according to the above steps. The binary tree algorithm is shown in FIG. 1. In the protocol of type B of the ISO 18000-6, the process of implementing anti-collision by using the binary tree algorithm is as follows: the reader-writer transmits a counting begin command to make all tags begin to respond; after the tags receive the commands, 0 or 1 are generated by a random number generator, in this way, the tags are divided into two subsets of which the random number is 0 and 1 respectively, which correspond to the binary tree and are called left branch (branch 0) and right branch (branch 1); the tags of which the random number is 0, namely the tags in the left branch, respond immediately, while for the tags of which the random number is 1, namely the tags in the right branch, set the value of a counter as 1 and can not perform splitting responding until waits to the end of the response of the left branch; if there is no collision and the response is successful, then the reader-writer transmits a command for acknowledgement and reduces the value of the tag counter by 1; if the tags collide, the reader-writer transmits a command to resplit the tags of which the counter value is 0, namely the tags in the left branch, and to add the counter value of tags of which the counter value is not zero, namely the tags in the right branch, by 1; and so forth, until all tags respond successfully.
From the description of the anti-collision process in protocol of type B of ISO 18000-6, it can be seen that, in the binary tree algorithm, binary splitting is performed at the left end of the tree, namely near the tags 0 each time, how to determine whether all tags in the communication field have been counted so as to finish the anti-collision process is not given in the standard. Currently, the generally used method is that, during counting, recording the possibly reachable maximum values of all the tag counters by using a register, the register is updated, each splitting, in case of no response or normal response, when the value of the register becomes 0, it is indicated that all tags in the communication field have been responded, and the counting process is finished. The specific steps are as shown in FIG. 1, comprising:
Step 101: at the beginning of counting, a reader-writer transmits a counting command to tags, and a register is set with an initial value.
Step 102: during counting, the reader-writer waits for response signals from the tags.
Step 103: if there is no response signal this time, then the reader-writer determines the value of the register, if the value of the register is less than or equal to 0, it means that counting is finished and then quit the counting flow; if the value of the register is greater than 0, then it means that counting is not finished, step 104 is to be executed to continue the counting process.
Step 104: the reader-writer determines a next command according to the response situation, and updates the value of the register according to the command; if the command transmitted by the reader-writer is a Fail command, the value of the register is added by 1; if the command transmitted by the reader-writer is a Success command, the value of the register is subtracted by 1; if the command transmitted by the reader-writer is another command, the value of the register is not adjusted.
Step 105: after the command is transmitted, returning to step 102 to continuing the counting process.
This algorithm makes a statistic to every change of a counter during the whole counting process which can theoretically ensure that all tags in the communication field are counted.
However, in practical applications, not all commands of the reader-writer can be received by a tag due to instability of the electromagnetic field, then there is a case in the tag that the counting commands are omitted or decoding error occurs, which causing that some tags may be omitted after the counting process is finished in practice. During the whole tag counting process, if a tag does not receive Success command of the reader-writer, then the value of tag counter will not be subtracted by 1, if the number of the omitted Success commands is relatively great, then the counters of some tags are still not set to 0 when the reader-writer finishes counting, such that these tags are not counted, resulting in tag omitting.